package controllers

import (
	"github.com/astaxie/beego"
	"ego/models"
)

type JsonController struct {
	beego.Controller
}

func (this *JsonController)Get()  {

	u := models.User{"123", "lxy", "456", models.Profile{"male", 20, "Singapore", "linxueyi2230@gmail.com"}}
	models.NewResponse().ToSuccess(&this.Controller,u)

}

func (this *JsonController)GetPhotos()  {

	var photos []string

	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")
	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")
	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")
	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")

	models.NewResponse().ToSuccess(&this.Controller,photos)
}
//注解路由
// @router /api/photos_urls
func (this *JsonController)PhotosUrl()  {

	var photos []string

	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")
	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")
	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")
	photos = append(photos,"http://img.qunawan.com/ecmme/wan/xl/goods/20160720/201607201646491688_list.jpg")

	models.NewResponse().ToSuccess(&this.Controller,photos)
}

